<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>title</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
	<style>

	   .display-block{
	   display :block ;
	   }
	   
	   .display-none{
	   display :none ;
	   }
	   

			

	</style>
</head>
<body>
<!--
  <header class="aui-bar aui-bar-nav" id="aui-header" style="background:#720eee;font-size:16px">
      <a class="aui-btn aui-pull-left"  tapmode onclick="closeWin() "style="color:#FFF">
          <span class="aui-iconfont aui-icon-left" style="color:#FFF"> </span>返回
      </a>
      <a class="aui-btn aui-pull-left" tapmode onclick="closeWd()"style="color:#FFF" >
          关闭
      </a>
      <div id="title" class="aui-title" style="color:#FFF">聚眾影視</div>
      <a id="play" class="aui-btn aui-pull-right" style="color:#fff000 !important;font-weight:bold" tapmode onclick="huanxian()">
           点此12播放
      </a>


  </header>

-->


   <header class="aui-bar aui-bar-nav" id="aui-header" style="background: linear-gradient(to right,#f370af 0,#5515ee 100%);">
        <a class="aui-btn aui-pull-left" tapmode onclick="ios_inwin('Back')">
            <span class="" style="color:#FFF"><!--返回--></span>
			<
        </a>
        <a class="aui-btn aui-pull-left" tapmode onclick="closeWd()">
            <span class="" style="color:#FFF"><!--退出--></span>
			×
        </a>
      <div id="title" class="aui-title"> <img src="" style="width: 20px;display: inline;margin-right: 10px;"> 影视特权</div>
		
		<a class="aui-btn aui-pull-right display-none"   id="display-block-play" tapmode onclick="huanxian()">
            <span class="" style="color:#FFF"></span>
		点此播放
        </a>

									

		        <a class="aui-btn aui-pull-right" tapmode onclick="ios_inwin('shuaxin')">
            <span class="" style="color:#FFF"></span>
			↺
			<!--刷新-->
        </a>

		
    </header> 






</body>
<script type="text/javascript" src="../script/api.js" ></script>
<script type="text/javascript">
    var dataurl = '';
    var dataurl2 = '';
    var qiyiurl = '';
    var dcode = 1;
    var onoff = true;
    var jx_url1 = localStorage.getItem('jx_url1');
    var jx_url2 = localStorage.getItem('jx_url2');
    var need_go_away = false;
    var api_url = localStorage.getItem('api_url');
	
	
    var baores_uid = localStorage.getItem('baores_uid');
    var baores_token = localStorage.getItem('baores_token');
	
    var Analytical_type = localStorage.getItem('Analytical_type');
	

    apiready = function(){

      api.parseTapmode();
	  getJiexi();   //获取接口信息
      var header = $api.byId('aui-header');
      $api.fixStatusBar(header);
      var headerPos = $api.offset(header);
      var body_h = $api.offset($api.dom('body')).h;



 
			//系统返回键是否绑定
			if(localStorage.getItem('System_Return_Key_Binding') == 1){
				api.addEventListener({
					name:'keyback'
				},function(ret,err){

					ios_inwin('Back');

				});			
			}
															



/*
      var browser = api.require('webBrowser');
      browser.openView({
          url: api.pageParam.url,
		  progress:{
         color: '#2979ff'
       },
          rect: {
              x: 0,
              y: 0,
              w: 0,
              h: 0
          }
      }, function(ret, err) {
          switch (ret.state) {
              case 0:

                  break;
				  
              case 1:
			  
  			  
                  break;
              case 2:
			  
	api.hideProgress();  
	
		dataurl = ret.url;
        dataurl2 = dataurl;
              var url = $api.byId('newurl');
              newurl.innerHTML = '<i class="iconfont icon-svip"></i>'+ret.url;
                  break;
              case 3:
              var title = $api.byId('title');
              title.innerHTML = ' <img src="" style="width: 20px;display: inline;margin-right: 10px;">'+ret.title;
                  break;
              case 4:
                  break;
              default:
                  break; 
          }
      });




*/



	  
	  
	
	  
	  
	  

/*

      api.addEventListener({
          name: 'keyback'
      }, function(ret, err) {
        api.hideProgress();
        api.setScreenOrientation({
            orientation: 'portrait_up'
        });
        var browser = api.require('webBrowser');
        browser.historyBack(
          function(ret, err) {
              if (!ret.status) {
                  api.closeWin();
              }
          }
        );
      });
	  
	  */
	  
	  
	  
	  



	  
	  
////////////////////////////////////////////////////////////

  api.parseTapmode();
        //$api.fixStatusBar($api.dom('.header'));
        data=api.pageParam;
		
		

          api.openFrame({
          //   useWKWebView:true,  //屏蔽APP
              name: 'video_frame',
              url: api.pageParam.url,
		  progress:{
         color: '#2979ff'
       },
     //         bgColor:'widget://icon/icon150x150.png',
          //    softInputMode:'pan',
              rect: {
                  x: 0,
                  y: headerPos.h,
                  w: 'auto',
                  h: 'auto'
              }
          });
		  
	 
		 ios_inwin=function(n){
          if(n=='Back'){
                api.historyBack({
              frameName: 'video_frame'
          }, function(ret, err) {
              if (!ret.status) {
                api.closeWin({
                  name: 'video_win'
                });
              }
          });
        }else if(n=='shuaxin'){
          var jsfuns='history.go(0);';
          api.execScript({
          frameName: 'video_frame',
          script: jsfuns
        });
      }else if(n=='tuichu'){
        api.closeWin({
           name: 'video_win'
       });
      }
    }; 
		  
		var connectionType=api.connectionType;

   api.setFrameClient({
      frameName: 'video_frame'
  }, function(ret, err) {
  //    console.log("9900##" + JSON.stringify(ret));
      switch (ret.state) {

          case 2:setTimeout(function(){videojs()},1000);

                  dataurl = ret.url;
        dataurl2 = dataurl;
        //alert(dataurl2);
        var txurlc = dataurl2.split(":");
        var txurl = txurlc[1].slice(0,12);
        var ykurl = txurlc[1].slice(0,13);
        var ykdata = txurlc[1].slice(13);
        var funurl = txurlc[1].slice(0,11);
        //alert(ykurl);

        if (ykurl=='//m.youku.com') {

          var txurlc = dataurl2.split(":");
          var ykurl = txurlc[1].slice(0,13);
          var ykdata = txurlc[1].slice(13);
          dataurl2 = 'http://www.youku.com'+ykdata;
      }else {

      }
      if (ykurl=='//m.iqiyi.com') {

        var txurlc = dataurl2.split(":");
        var ykurl = txurlc[1].slice(0,13);
        var ykdata = txurlc[1].slice(13);
        dataurl2 = 'https://www.iqiyi.com'+ykdata;

      }else {

      }
      if (txurl=='//m.v.qq.com') {
        var txdata = dataurl2;
        var txget = new winsx(dataurl2);
        var vid = getParam('vid');
        var txdata2 = dataurl2.split("?");
        var cid = txdata2[0].slice(-20,-5)
        //alert(vid);

        if (vid.length == 11) {
          dataurl2 = 'https://v.qq.com/x/cover/'+cid+'/'+vid+'.html';

        }else {
          dataurl2 = 'https://v.qq.com/x/cover/'+cid+'.html';

        }

      }else {

      }
      if (ykurl=='//m.le.com/vp') {
        var leurlc = dataurl2.split("_");
        var leurl = leurlc[1];
        dataurl2 = 'http://www.le.com/ptv/vplay/'+leurl;
      }else {

      }
      var txdeurl = dataurl2.split(":");
      var detxurl = txdeurl[1].slice(0,29);
      if (detxurl == '//v.qq.com/x/cover/.v.qq.com/') {
        dataurl2 = 'https://v.qq.com/';
      }else {

      }


				  var bturl = dataurl2.split(":");
				  var feurl = bturl[1];
				  if (feurl.slice(0,18) == '//www.iqiyi.com/v_' 
					  ||feurl.slice(0,19) == '//v.qq.com/x/cover/'
					  ||feurl.slice(0,17) == '//m.tv.sohu.com/v'
					  ||feurl.slice(0,23) == '//m.film.sohu.com/album'
					  ||feurl.slice(0,14) == '//m.mgtv.com/b'
					  ||feurl.slice(0,21) == '//www.youku.com/video'
					  ||feurl.slice(0,22) == '//www.le.com/ptv/vplay'
					  ||feurl.slice(0,30) == '//www.wasu.cn/wap/play/show/id'
					  ||feurl.slice(0,30) == '//www.wasu.cn/wap/Play/show/id'
					  ||feurl.slice(0,17) == '//m.pptv.com/show'
					  ||feurl.slice(0,60) == '//m.miguvideo.com/wap/resource/migu/miguH5/detail/detail.jsp') {
						if (!onoff) {
          return;
        }
      }else {

      }
          	break;
          case 4:
          	//if(connectionType!='wifi'){setTimeout(function(){videojs()},3000)};
          	videojs();
			
			
			 						var obj = document.getElementById("display-block-play");
									obj.setAttribute("class", "aui-btn aui-pull-right display-block"); 
									
 
 
			
			
			
          	if(need_go_away){
          		dataurl2 = ret.url;
          		playVideo();
          		need_go_away = false;
          	}
          case 3:

  			page_title = ret.title;
          	break;
      }
  });

  api.addEventListener({
      name: 'getUrl'
  }, function(ret, err) {
    if(ret && ret.value){
   //   alert(ret.value.herf);
      var value = ret.value;
      huanxian(value.herf,value.title);
  }
  });
};

//初始化结束










  
	 


///////解析接口获取

  function getJiexi(){
  
  
      var user_id = localStorage.getItem('user_id');

	        if (user_id>1) {

        api.ajax({
            url: api_url+'/login/login/Parsing_interface.html',
            method: 'get',
            data: {
                values: {
					key: 'qq166098756',   //安全码
                    uid: user_id
                }
            }
        },function(ret, err){
            if (ret) {
              localStorage.setItem('jx_url1',ret.msg.url1);
              localStorage.setItem('jx_url2',ret.msg.url2);
              localStorage.setItem('jx_url3',ret.msg.url3);
              localStorage.setItem('jx_url4',ret.msg.url4);
              localStorage.setItem('jx_url5',ret.msg.url5);
              localStorage.setItem('jx_url6',ret.msg.url6); 
              localStorage.setItem('jx_url7',ret.msg.url7); 
              localStorage.setItem('jx_url8',ret.msg.url8); 
              localStorage.setItem('jx_url9',ret.msg.url9); 
			  
              localStorage.setItem('jx_url1_name',ret.msg.url1_name);
              localStorage.setItem('jx_url2_name',ret.msg.url2_name);
              localStorage.setItem('jx_url3_name',ret.msg.url3_name);
              localStorage.setItem('jx_url4_name',ret.msg.url4_name);
              localStorage.setItem('jx_url5_name',ret.msg.url5_name);  
              localStorage.setItem('jx_url6_name',ret.msg.url6_name); 
              localStorage.setItem('jx_url7_name',ret.msg.url7_name); 
              localStorage.setItem('jx_url8_name',ret.msg.url8_name); 
              localStorage.setItem('jx_url9_name',ret.msg.url9_name); 
			  
              localStorage.setItem('app_name',ret.msg.app_name); 

                if (ret.msg.imei!=api.deviceId) {
                  localStorage.setItem('user_id','');
                  localStorage.setItem('user_name','');
                  localStorage.setItem('user_time','');
                  api.sendEvent({
                    name: 'newLoingdata',
                    extra: {
                    }
                  });

                  api.closeWin({
                  });

                  api.alert({
                      title: '您已在其他设备登陆！账号已强制下线',
                      msg: '请重新登陆',
                  });
                  return;





                }
            } else {



            }
        });
      }
	  
	  

  }


 
	  
	  
	  
	  
	  
	  









function videojs(){
   var data=api.pageParam;
   var jsfun='';
   var tu = localStorage.getItem('api_url')+'static/appimg/video.gif';
   //alert(tu);
   if(api.pageParam.url.indexOf("iqiyi.com")!= -1){
     jsfun="var iframe=document.getElementById('_if');if(iframe){api.toast({msg: '爱奇艺官方错误!稍等自动刷新'});history.go(0)};var i=document.getElementsByClassName('m-video-player-wrap')[0];if(typeof(i) != 'undefined'){i.style.height='220px';i.style.color='#fff';i.style.lineHeight='15';i.style.position='static';i.style.paddingTop='0%';i.style.background='#000000';i.style.textAlign='center';i.innerHTML='<div><img src=\"http://juzhongyingshi.wuguq.cn/bofangyemian.png\" title=\"视频已为您连接成功,点击图片即可播放!\" width=\"100%\" height=\"100%\"></div>';api.toast({msg: '视频已为您连接成功,点击图片即可播放!', duration: 5000});i.addEventListener('touchstart',function(){api.sendEvent({name:'getUrl',extra:{herf:window.location.href,title:document.title}})})}";
   }else if(api.pageParam.url.indexOf("v.qq.com")!= -1){
     jsfun="var i=document.getElementsByClassName('mod_player')[0];if(typeof(i) != 'undefined'){i.style.height='210px';i.style.background='#000000';i.style.textAlign='center';i.style.color='#fff';i.style.lineHeight='14';i.innerHTML='<div><img src=\"http://juzhongyingshi.wuguq.cn/bofangyemian.png\" title=\"视频已为您连接成功,点击图片即可播放!\" width=\"100%\" height=\"100%\"></div>';i.addEventListener('touchstart',function(e){api.sendEvent({name:'getUrl',extra:{herf:window.location.href,title:document.title}})})}";
   }else if(api.pageParam.url.indexOf("m.le.com")!= -1){
     jsfun="var i=document.getElementsByClassName('playB')[0];if(typeof(i) != 'undefined'){i.style.background='#000000';i.innerHTML='<div><img src=\"http://juzhongyingshi.wuguq.cn/bofangyemian.png\" title=\"视频已为您连接成功,点击图片即可播放!\" width=\"100%\" height=\"100%\"></div>';i.style.width='100%';i.style.textAlign='center';i.style.lineHeight='14';i.style.color='#fff';api.toast({msg: '视频已为您连接成功,点击图片即可播放!', duration: 5000});i.addEventListener('touchstart',function(e){api.sendEvent({name:'getUrl',extra:{herf:window.location.href,title:document.title}})})}";
   }else if(api.pageParam.url.indexOf("youku.com")!= -1){
     jsfun="var i=document.getElementById('playerBox');if(typeof(i) != 'undefined'){i.style.background='#000000';i.style.color='#fff';i.style.textAlign='center';i.style.lineHeight='15';i.innerHTML='<div><img src=\"http://juzhongyingshi.wuguq.cn/bofangyemian.png\" title=\"视频已为您连接成功,点击图片即可播放!\" width=\"100%\" height=\"100%\"></div>';api.toast({msg:'视频已为您连接成功,点击图片即可播放!', duration: 5000});i.addEventListener('touchstart',function(e){api.sendEvent({name:'getUrl',extra:{herf:window.location.href,title:document.title}})})}";
   }else if(api.pageParam.url.indexOf("mgtv.com")!= -1){
     jsfun="var i=document.getElementsByClassName('video-area')[0];if(typeof(i) != 'undefined'){i.style.background='#000000';i.style.color='#fff';i.style.textAlign='center';i.style.lineHeight='16';i.innerHTML='<div><img src=\"http://juzhongyingshi.wuguq.cn/bofangyemian.png\" title=\"视频已为您连接成功,点击图片即可播放!\" width=\"100%\" height=\"100%\"></div>';api.toast({msg: '视频已为您连接成功,点击图片即可播放!', duration: 5000});i.addEventListener('click',function(e){api.sendEvent({name:'getUrl',extra:{herf:window.location.href,title:document.title}})})}";
   }else if(api.pageParam.url.indexOf("sohu.com")!= -1){
     jsfun="var i=document.getElementsByClassName('x-player')[0];var x=document.getElementById('top-poster');if(typeof(i) != 'undefined'){i.style.background='#000000';i.style.color='#fff';i.style.textAlign='center';i.style.lineHeight='13';i.innerHTML='<div><img src=\"http://juzhongyingshi.wuguq.cn/bofangyemian.png\" title=\"视频已为您连接成功,点击图片即可播放!\" width=\"100%\" height=\"100%\"></div>';api.toast({msg: '视频已为您连接成功,点击图片即可播放!', duration: 5000});i.addEventListener('touchstart',function(e){api.sendEvent({name:'getUrl',extra:{herf:window.location.href,title:document.title}})})}else if(typeof(x) != 'undefined'){x.style.background='#000000';x.style.color='#fff';x.style.height='210px';x.style.textAlign='center';x.style.lineHeight='13';x.innerHTML='<div><img src=\"http://juzhongyingshi.wuguq.cn/bofangyemian.png\" title=\"视频已为您连接成功,点击图片即可播放!\" width=\"100%\" height=\"100%\"></div>';api.toast({msg: '视频已为您连接成功,点击图片即可播放!'});x.addEventListener('click',function(){api.sendEvent({name:'getUrl',extra:{herf:window.location.href,title:document.title}})})}";
   }else if(api.pageParam.url.indexOf("fun.tv")!= -1){
     jsfun="var myVideo=document.getElementById('m-h5v-video-1');if(typeof(myVideo) != 'undefined'){myVideo.pause()};var i=document.getElementById('m-h5v-player-1');if(typeof(i) != 'undefined'){i.style.background='#000000';i.style.color='#fff';i.style.lineHeight='12';i.innerHTML='<div><img src=\"http://juzhongyingshi.wuguq.cn/bofangyemian.png\" title=\"视频已为您连接成功,点击图片即可播放!\" width=\"100%\" height=\"100%\"></div>';api.toast({msg: '视频已为您连接成功,点击图片即可播放!', duration: 5000});i.addEventListener('touchstart',function(e){api.sendEvent({name:'getUrl',extra:{herf:window.location.href,title:document.title}})})}";
   }else if(api.pageParam.url.indexOf("baofeng.com")!= -1){
     jsfun="var myVideo=document.getElementsByTagName('video')[0];myVideo.pause();var i=document.getElementById('videoplayer');if(typeof(i) != 'undefined'){i.style.background='#000000';i.style.textAlign='center';i.style.color='#fff';i.style.lineHeight='17';i.innerHTML='<div><img src=\"http://juzhongyingshi.wuguq.cn/bofangyemian.png\" title=\"视频已为您连接成功,点击图片即可播放!\" width=\"100%\" height=\"100%\"></div>';api.toast({msg: '视频已为您连接成功,点击图片即可播放!', duration: 5000});i.addEventListener('touchstart',function(e){api.sendEvent({name:'getUrl',extra:{herf:window.location.href,title:document.title}})})}";
   }else if(api.pageParam.url.indexOf("bilibili.com")!= -1){
     jsfun="var i=document.getElementById('bofqi');i.style.background='#000000';i.style.lineHeight='10';if(typeof(i) != 'undefined'){i.style.color='#fff';i.style.textAlign='center';i.innerHTML='<div><img src=\"http://juzhongyingshi.wuguq.cn/bofangyemian.png\" title=\"视频已为您连接成功,点击图片即可播放!\" width=\"100%\" height=\"100%\"></div>';api.toast({msg: '视频已为您连接成功,点击图片即可播放!', duration: 5000});i.addEventListener('touchstart',function(e){api.sendEvent({name:'getUrl',extra:{herf:window.location.href,title:document.title}})})}";
   }else if(api.pageParam.url.indexOf("miguvideo.com")!= -1){
     jsfun="var i=document.getElementsByClassName('fixedHeader')[0];if(typeof(i) != 'undefined'){i.style.height='220px';i.style.color='#fff';i.style.fontSize='14px';i.style.lineHeight='15';i.style.background='#000000';i.style.textAlign='center';i.innerHTML='<div><img src=\"http://juzhongyingshi.wuguq.cn/bofangyemian.png\" title=\"视频已为您连接成功,点击图片即可播放!\" width=\"100%\" height=\"100%\"></div>';api.toast({msg: '视频已为您连接成功,点击图片即可播放!', duration: 5000});i.addEventListener('touchstart',function(e){api.sendEvent({name:'getUrl',extra:{herf:window.location.href,title:document.title}})})}";
   }else if(api.pageParam.url.indexOf("1905.com")!= -1){
     jsfun="var i=document.getElementById('player');if(typeof(i) != 'undefined'){i.style.color='#fff';i.style.fontSize='14px';i.style.lineHeight='16';i.style.background='#000000';i.style.textAlign='center';i.innerHTML='<div><img src=\"http://juzhongyingshi.wuguq.cn/bofangyemian.png\" title=\"视频已为您连接成功,点击图片即可播放!\" width=\"100%\" height=\"100%\"></div>';api.toast({msg: '视频已为您连接成功,点击图片即可播放!', duration: 5000});i.addEventListener('touchstart',function(e){api.sendEvent({name:'getUrl',extra:{herf:window.location.href,title:document.title}})})}";
   }else if(api.pageParam.url.indexOf("17173.com")!= -1){
     jsfun="var i=document.getElementById('videoplay');if(typeof(i) != 'undefined'){i.style.color='#fff';i.style.fontSize='14px';i.style.lineHeight='16';i.style.background='#000000';i.style.textAlign='center';i.innerHTML='<div><img src=\"http://juzhongyingshi.wuguq.cn/bofangyemian.png\" title=\"视频已为您连接成功,点击图片即可播放!\" width=\"100%\" height=\"100%\"></div>';api.toast({msg: '视频已为您连接成功,点击图片即可播放!', duration: 5000});i.addEventListener('touchstart',function(e){api.sendEvent({name:'getUrl',extra:{herf:window.location.href,title:document.title}})})}";
   }else if(api.pageParam.url.indexOf("pptv.com")!= -1){
     jsfun="var i=document.getElementById('playerbox');if(typeof(i) != 'undefined'){i.style.color='#fff';i.style.lineHeight='12';i.style.background='#000000';i.style.textAlign='center';i.innerHTML='<div><img src=\"http://juzhongyingshi.wuguq.cn/bofangyemian.png\" title=\"视频已为您连接成功,点击图片即可播放!\" width=\"100%\" height=\"100%\"></div>';api.toast({msg: '视频已为您连接成功,点击图片即可播放!', duration: 5000});i.addEventListener('touchstart',function(e){api.sendEvent({name:'getUrl',extra:{herf:window.location.href,title:document.title}})})}";
   }

     api.execScript({
     frameName: 'video_frame',
     script: jsfun
   });
 }
 
 function getCaption(obj){
   var index=obj.lastIndexOf("\=");
   obj=obj.substring(index+1,obj.length);
   return obj;
 }

 function huanxian(){
   //alert(dataurl2);
   var user_id = localStorage.getItem('user_id');
   if(user_id<1){
     api.alert({
         title: '温馨提示',
         msg: '请先登陆后使用',
     });
     api.openWin({
         name: 'login',
         url: './login.html',
         delay: 300
     });
     return;

   }
   api.showProgress({
       title: '获取VIP信息',
       modal: false
   });
   
   
   var browser = api.require('webBrowser');
     api.execScript({
     frameName: 'video_frame',
     script: 'location.reload();'
   });
   need_go_away = true;

 }

 function playVideo(){
 	//alert(223+dataurl2);
   api.hideProgress();
   
 //  openVideoWin(dataurl2,'TESTST');
 // alert('123'+page_title+dataurl2);
			//如果解析播放模式为 本地播放
		var title = page_title;
			
		   if(localStorage.getItem('Analytical_type') == 1 ){
		    
				   		var delay = 0;
						if(api.systemType != 'ios') {
							delay = 300;
						}
						api.openWin({
							name: 'video_jiexi_api_play_win',
							url: 'video_jiexi_api_play_win.html',
							bounces: false,
							delay: delay,
							slidBackEnabled: true,
							vScrollBarEnabled: false,
							pageParam:{video:dataurl2,title:page_title}
							
						});
			//如果为2
		   }else if(localStorage.getItem('Analytical_type') == 2 ){
		   

					//////////////////////    获取解析API接口解析值  //////////////////////
		

							api.ajax({
								url: 'http://jx3.u4z.cn/?url=', 
								method: 'get',              
								data: {
								  values: {
									uid: baores_uid,   
									token: baores_token,   
									wap: 1,   
									url: dataurl2  
								  }
							  }
							}, function(ret, err) {
								if(ret) {
					//		alert( JSON.stringify( ret.url ) );  
										if(ret.code = 200){
										

				//	alert('123'+page_title+ret.url);

										 	openvideoPlayer(ret.url,title);
		
										}else{
										
										
										alert( '解析错误' );
										
										}
										
									
									api.hideProgress();

								} else {
									api.hideProgress();
									//alert( JSON.stringify( err ) );
								}
							});

					//////////////////////    获取解析API接口解析值  //////////////////////		

		   
		   
		   
		   
		   //  否则 调用x5
		   }else{

			   api.openWin({
				   name: 'video_jiexi_play_win',
				   url: './video_jiexi_play_win.html',
				   delay: 300,
				   pageParam:{
						url:jx_url1+dataurl2,
						srcUrl:dataurl2,
						title:page_title,
						needRecordHistory: true
					},
				   //pageParam:{url:dataurl2},
				   bgColor: '#000000'
			   });
				   
		   
		   }
     
   
   
   




 }





		//本地播放器v2
		function openvideoPlayer(url,name) {
		
		 
				//加载播放器
		         var videoPlayer = api.require('videoPlayer');
					videoPlayer.play({
						texts: {
							head: {
								title: name+'播放'
							}
						},
						styles: {
							head: {								 //（可选项）JSON对象；播放器顶部导航条样式    	
								bg: 'rgba(0.5,0.5,0.5,0.7)',		 //（可选项）字符串类型；顶部导航条背景，支持#、rgb、rgba、img；默认：rgba(161,161,161,0.5)
								height: 44,							     //（可选项）数字类型；顶部导航条的高；默认：44
								titleSize: 15,							  //（可选项）数字类型；顶部标题字体大小；默认：20
								titleColor: '#fff',							 //（可选项）字符串类型；顶部标题字体颜色；默认：#fff
								backSize: 25,								//（可选项）数字类型；顶部返回按钮大小；默认：44
								backImg: 'widget://Ryanimg/user/Close.png',		//（可选项）字符串类型；顶部返回按钮的背景图片，要求本地路径（widget://、fs://）；默认：返回小箭头图标
								setSize: 25,										//（可选项）数字类型；顶部右边设置按钮大小；默认：44
								setImg: 'widget://Ryanimg/user/setup.png'			//（可选项）字符串类型；顶部右边设置按钮背景图片，要求本地路径（widget://、fs://）；默认：设置小图标
							},		
							foot: {							 //（可选项）JSON对象；播放器底部导航条样式    	
								bg: 'rgba(0.5,0.5,0.5,0.7)',			//（可选项）字符串类型；底部导航条背景，支持#、rgb、rgba、img；默认：rgba(161,161,161,0.5)
								height: 44,								//（可选项）数字类型；底部导航条的高；默认：44
								playSize: 25,							//（可选项）数字类型；底部播放/暂停按钮大小；默认：44
								playImg: 'widget://Ryanimg/user/play.png',			//（可选项）字符串类型；底部播放按钮的背景图片，要求本地路径（widget://、fs://）；默认：播放按钮图标
								pauseImg: 'widget://Ryanimg/user/pause.png',			//（可选项）字符串类型；底部暂停按钮的背景图片，要求本地路径（widget://、fs://）；默认：暂停按钮图标
								nextSize: 25,											//（可选项）数字类型；底部下一集按钮大小；默认：44
								nextImg:'widget://Ryanimg/user/pns.png',  				//（可选项）字符串类型；底部下一集按钮的背景图片，要求本地路径（widget://、fs://）；默认：下一集按钮图标
								timeSize: 14,									 //（可选项）数字类型；底部时间标签大小；默认：14
								timeColor: '#fff',					    //（可选项）字符串类型；底部时间标签颜色，支持#、rgba、rgb；默认：#fff
								sliderImg: 'widget://image/videoPlayer/unfullscreen.png',					//（可选项）字符串类型；底部进度条滑块背景图片，要求本地路径（widget://、fs://）；默认：滑块小图标((在iOS上需要添加二倍图或者三倍图,否则会出现毛边))
								progressColor: '#696969',			 //（可选项）字符串类型；进度条背景色，支持#、rgba、rgb；默认：#696969
								progressSelected: '#1296db',			 //（可选项）字符串类型；滑动后的进度条背景色，支持#、rgb、rgba；默认：#76EE00
								verticalImg: "widget://Ryanimg/user/ExitFullScreen.png",		 //（可选项）字符串类型；底部竖屏按钮的背景图片，要求本地路径（widget://、fs://）；默认：竖屏按钮图标              
								horizontalImg: "widget://Ryanimg/user/fullscreen.png"			//（可选项）字符串类型；底部横屏按钮的背景图片，要求本地路径（widget://、fs://）；默认：横屏按钮图标
							}
						},
						  
						coverImg: "widget://image/videoPlayer/fullscreen.png",		//	（可选项）封面图路径，播放器打开尚未播放时的封面图，要求本地路径（widget://、fs://）
						path: url,		//	（可选项）文档的路径，支持网络和本地（fs://）路径，在 android 平台上不支持 widget	
						seekBarDragable: true,		//	（可选项） 播放进度条是否可以拖动
						autoPlay: true					//（可选项）打开时是否自动播放		默认值：true（自动播放）
					}, function(ret, err) {
						if (ret) {
						
						
			 // alert(JSON.stringify(ret));	    /**/															
				

							if(ret.eventType == 'show'){
							
				
				/*
																api.toast({
																	msg: '打开成功并显示',
																	duration: 11000,
																	location : 'middle' 
																});
				*/
			
				}else if(ret.eventType == 'back'){
				
				
														/*		api.toast({
																	msg: '返回',
																	duration: 1000,
																	location : 'middle' 
																});
																*/
			var videoPlayer = api.require('videoPlayer');
			videoPlayer.close();
							
							}else if(ret.eventType == 'play'){
							
							
																			api.toast({
																				msg: '播放',
																				duration: 1000,
																				location : 'middle' 
																			});
							
							
							
							}else if(ret.eventType == 'pause'){
							
							
																			api.toast({
																				msg: '暂停',
																				duration: 1000,
																				location : 'middle' 
																			});
							
							
							
							}else if(ret.eventType == 'next'){
							
							
																			api.toast({
																				msg: '下一集',
																				duration: 1000,
																				location : 'middle' 
																			});
							
							
							
							}else if(ret.eventType == 'failed'){
							
							
																			api.toast({
																				msg: '播放失败',
																				duration: 1000,
																				location : 'middle' 
																			});
							
							
							 
							}




						} else {
				alert(JSON.stringify(err));
						}
					});
					   
}












		//////////////////////   打开推荐影片播放页  方法         S //////////////////////
		function openVideoWin(url,name) {

			////获取数据
			var time = localStorage.getItem('user_time');
			var user_id = localStorage.getItem('user_id');
			var username = localStorage.getItem('user_name');
			var timestamp = Date.parse(new Date()) / 1000;

			///判断是否登录
			if(user_id == 0) {

				/*
				api.alert({
				    title: '温馨提示',
				    msg: '请先登陆后使用',
				});

				*/
				api.toast({
					msg: '还没登陆！',
					duration: 1000, 
                location : 'middle' 
				});

				api.openWin({
					name: 'login',
					url: './login.html',
					delay: 300,
											
						
				bounces: false,
				slidBackEnabled: true,
				bgColor: '#000',
				animation: {
					type: "reveal", //动画类型（详见动画类型常量） 
					subType: "from_top", //动画子类型（详见动画子类型常量）
					duration: 400
				},
				vScrollBarEnabled: false
						
					
					
				});
				return;

			}

			//判断是否会员
			if(time > timestamp) {


						var delay = 0;
						if(api.systemType != 'ios') {
							delay = 300;
						}
						api.openWin({
							name: 'video_jiexi_api_play_win',
							url: 'video_jiexi_api_play_win.html',
							bounces: false,
							delay: delay,
							slidBackEnabled: true,
							vScrollBarEnabled: false,
						/*	pageParam: {
								video: name
							}
							*/
							pageParam:{video:url,title:name}
							
						});



			} else if(time == -1) { //判断是否永久会员
			
						var delay = 0;
						if(api.systemType != 'ios') {
							delay = 300;
						}
						api.openWin({
							name: 'video_play_win',
							url: 'video_play_win.html',
							bounces: false,
							delay: delay,
							slidBackEnabled: true,
							vScrollBarEnabled: false,
						
							pageParam:{video:url,title:name}
						});

					 

			} else if(time < timestamp) {
				VipExpiredHint(); //会员过期弹窗提示
			}

		}

		//////////////////////   打开推荐影片播放页  方法        E //////////////////////














 function getParam(name) {

     return dataurl2.match(new RegExp('[?&]' + name + '=([^?&]+)', 'i')) ? decodeURIComponent(RegExp.$1) : '';

 }


 
       function closeWin(){
      var browser = api.require('webBrowser');
      browser.historyBack(
        function(ret, err) {
            if (!ret.status) {
                api.closeWin();
            }
        }
      );
    }

    function closeWd(){
      api.closeWin();
    }


 function vipHuanxian(jiekou){
 	alert("ddd" + dataurl2);
   var user_id = localStorage.getItem('user_id');
   if(user_id<1){
     api.alert({
         title: '温馨提示',
         msg: '请先登陆后使用',
     });
     api.openWin({
         name: 'login',
         url: './login.html',
         delay: 300
     });
     return;

   }

   var systemType = api.systemType;
   if (systemType == 'android') {
     api.openWin({
         name: 'video_jiexi_play_win',
         url: './video_jiexi_play_win.html',
         delay: 300,
         pageParam:{url:jiekou+dataurl2},
         bgColor: '#000000'
     });
   }
   
   /* else {
     var browser = api.require('webBrowser');
     browser.open({
         url: jiekou+dataurl2,
         titleBar: {
           visible: true
         }
     });

   }
   
   */

 }
  </script>  
  </html>
 